﻿<Window x:Class="Gaming_club.Windows.RegistrationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Gaming_club.Windows"
        mc:Ignorable="d"
        Title="РЕГИСТРАЦИЯ" Height="700" Width="425">
    <Window.Resources>
        <Style TargetType="TextBox" x:Key="PlaceholderTextBoxStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid>
                            <Border Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"/>
                            <TextBlock x:Name="PlaceholderText"
                                       Text="{TemplateBinding Tag}"
                                       Visibility="Collapsed"
                                       Margin="4,0,0,0"
                                       Foreground="Gray"
                                       VerticalAlignment="Center"
                                       FontSize="16"/>
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Text" Value=""/>
                                    <Condition Property="IsFocused" Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="PlaceholderText" Property="Visibility" Value="Visible"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="NoHoverButton" TargetType="Button">
            <Setter Property="Background" Value="#34c6cd"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontFamily" Value="Segoe UI Black"/>
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#34c6cd"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        
    </Window.Resources>
    <Grid>


        <Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10">
            <Image Source="/image/Логотип.png" HorizontalAlignment="Center" 
               VerticalAlignment="Top" Height="70" Width="396"/>

            <Label Content="РЕГИСТРАЦИЯ" HorizontalAlignment="Center" 
               Margin="0,70,0,0" VerticalAlignment="Top" 
               FontFamily="Segoe UI Black" FontSize="24"/>
            <TextBox Name="txtName" HorizontalAlignment="Center" Height="36" Margin="0,113,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380" 
                 Style="{StaticResource PlaceholderTextBoxStyle}" Tag="Введите имя"
                 VerticalContentAlignment="Center"  FontSize="16"/>

            <TextBox Name="txtSurname" HorizontalAlignment="Center" Height="36" Margin="0,154,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380" 
                 Style="{StaticResource PlaceholderTextBoxStyle}" Tag="Введите фамилию"
                 VerticalContentAlignment="Center"  FontSize="16"/>

            <TextBox Name="txtPatrynumic" HorizontalAlignment="Center" Height="36" Margin="0,195,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380" 
                 Style="{StaticResource PlaceholderTextBoxStyle}" Tag="Введите отчество"
                 VerticalContentAlignment="Center"  FontSize="16"/>

            <TextBox x:Name="txtPhoneNumber" Margin="0,236,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380"
                 PreviewTextInput="TextBox_PreviewTextInput" Height="36"
                 TextChanged="TextBox_TextChanged"
                 Style="{StaticResource PlaceholderTextBoxStyle}"
                 Tag="Введите номер телефона"
                 VerticalContentAlignment="Center" FontSize="16"/>

            <TextBox Name="txtAge" HorizontalAlignment="Center" Height="36" Margin="0,277,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380" 
                 Style="{StaticResource PlaceholderTextBoxStyle}" Tag="Введите возраст"
                 VerticalContentAlignment="Center"
                 FontSize="16" MaxLength="2"/>

            <TextBox Name="txtLogin" HorizontalAlignment="Center" Height="36" Margin="0,318,0,0" 
                 TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="380" 
                 Style="{StaticResource PlaceholderTextBoxStyle}" Tag="Введите логин"
                 VerticalContentAlignment="Center"  FontSize="16" />

            <PasswordBox x:Name="txtPassword" HorizontalAlignment="Center" Height="36" 
                 Password="" VerticalAlignment="Top" Width="380" Margin="0,385,0,0"
                     />

            <PasswordBox Name="txtConfirmPassword" HorizontalAlignment="Center" Height="36" Margin="0,452,0,0" 
                 Password="" VerticalAlignment="Top" Width="380" 
                />
            <Button Name="btnShowPassword" Content="Показать пароль" 
                    HorizontalAlignment="Center" Margin="0,520,0,0" 
                VerticalAlignment="Top" RenderTransformOrigin="0.272,0.117" 
                Click="Button_Click" BorderBrush="Transparent"/>

            <Grid x:Name="gridPassword" HorizontalAlignment="Left" Height="29" 
              Margin="10,486,0,0" VerticalAlignment="Top" Width="380"/>


            <Button x:Name="btnReg" Content="РЕГИСТРАЦИЯ" 
                HorizontalAlignment="Center" Height="45"
                Margin="0,545,0,0" VerticalAlignment="Top" Width="380" 
                Background="#34c6cd" Foreground="White" 
                BorderBrush="Transparent" FontFamily="Segoe UI Black" 
                FontSize="16" Style="{StaticResource NoHoverButton}" 
                MouseEnter="btnReg_MouseEnter" MouseLeave="btnReg_MouseLeave" 
                Click="btnReg_Click"/>
            <Label Content="Введите пароль" HorizontalAlignment="Center" 
               Height="26" Margin="9,359,0,0" VerticalAlignment="Top" Width="107"/>
            <Label Content="Повторите пароль" HorizontalAlignment="Center" 
            Height="26" Margin="0,426,0,0" VerticalAlignment="Top" Width="116"/>

            <Button x:Name="btnBack" Content="ВЕРНУТСЯ НА ГЛАВНУЮ" 
                HorizontalAlignment="Center" Height="45"
                Margin="0,595,0,0" VerticalAlignment="Top" Width="380" 
                Background="#33c6cd" Foreground="White" 
                BorderBrush="Transparent" FontFamily="Segoe UI Black" 
                FontSize="16" Style="{StaticResource NoHoverButton}" 
                MouseEnter="btnBack_MouseEnter" MouseLeave="btnBack_MouseLeave" 
                Click="btnBack_click"/>
        </Grid>

    </Grid>
</Window>
